<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
  <head>
    <title> <?php echo $this->content_for_layout;?></title>
        <?php
            echo $this->element('global/head');
        ?>
    </head>
</html>
<body>
    

    <div id="wrapper">
        <div id="header">
            <div class="wrapper">
                <?php echo $this->element('global/logo');?>
                
                <div id="headerNav" >

                    <?php echo $this->element('navUserAccount', array(
                                        'isConnected' => !empty($currentUser),
                                        'currentUser' => (!empty($currentUser) ? $currentUser : false)
                                    )
                            );
                    ?>
                </div>
            </div>
        </div>

        <div id="content">
            <div class="wrapper">
                <div id="notifications">
                    <?php
                    echo $this->Session->flash();
                    echo $this->Session->flash('Auth');
                    ?>
                </div>
                
                
                    <div class="blocAction">
                       masquer
                    </div>
                
                <div class="colHomeNav">
                    <?php 
                    if (!empty($data2)){
                    ?>
                    
                        <?php
                        // Si l'utilisateur est membre du groupe qu'il consulte, affichage du menu
                        if ($currentUser['UserGroup'] && $currentUser['UserGroup']['groups_id'] == $data2['Group']['id'] && $currentUser['UserGroup']['status'] == 'in'){
                        ?>
                            <h3 class="title">Liens</h3>
                            <ul>
                                <li> <?php echo $this->Html->link('Accueil', array('action' => 'home', 'controller' => 'Groups'));?> </li>
                                <li> <?php echo $this->Html->link('Chat', array('action' => 'view', 'controller' => 'chats',$currentUser['UserGroup']['groups_id']));?> </li>
                                <li> <?php echo $this->Html->link('Informations', array('action' => 'view', 'controller' => 'Groups', $currentUser['UserGroup']['groups_id']));?> </li>
                            </ul>
                            <?php
                            if ($data2['Group']['status'] == 'active'){
                            ?>
                                <h3 class="title">Actions</h3>
                                <ul>
                                    <li> <?php echo $this->Html->link('Lois', array('action' => 'view', 'controller' => 'ActionLaws'));?> </li>
                                    <li> <?php echo $this->Html->link('Sondage', array('action' => 'home', 'controller' => 'ActionPolls'));?> </li>
                                    <li> <?php echo $this->Html->link('Evènement', array('action' => 'calendar', 'controller' => 'ActionEvents'));?> </li>
                                    <li> <?php echo $this->Html->link('Article', array('action' => 'home', 'controller' => 'ActionPosts'));?> </li>
                                    <li> <?php echo $this->Html->link('Membres', array('action' => 'members', 'controller' => 'Groups'));?> </li>
                                </ul> 
                                <?php
                            }
                            ?>
                            <h3 class="title"> Options </h3>
                            <ul>
                                <li> <?php echo $this->Html->link('Paramètres', array('action' => 'settings', 'controller' => 'Groups'));?> </li>
                            </ul> 
                        <?php
                        }
                        else{
                            ?>
                            <h3>Liens</h3>
                            <ul>
                                <li> <?php echo $this->Html->link('Informations', array('action' => 'view', 'controller' => 'Groups', $data2['Group']['id']));?> </li>  
                                <li> <?php echo $this->Html->link('Vers la ville', array('action' => 'view', 'controller' => 'PlaceCities', $data2['Group']['cities_id']));?> </li>                                
                            </ul>
                             <?php
                        }
                    }
                        ?>
                            
                            
                </div>
                <div class="colMainContent">
                                
                    <?php
                        echo $content_for_layout;
                    ?>
                </div>
            </div>
        </div>
        <div id="bottom">
            <div class="wrapper">
              

            </div>
        </div>
    </div>


        
    </div>
<script type="text/javascript">
$(document).ready(function(){
    
    $(".blocAction").toggle(
        function(){
            $(".colMainContent").width('100%');
            $(".colHomeNav").hide();
            $(".blocAction").html("navigation");
            $(".blocAction").css('background','#bfcebc');
            
        },
        function(){
            $(".colMainContent").width('79%');
            $(".colHomeNav").show('slow');
            $(".blocAction").html("masquer");
            $(".blocAction").css('background','none');
  
        }
    );
    

    //quant on clique sur le div blocaction
/*
    $(".blocAction").click(function(){
    //si le div deroulant est caché on le montre

    if($(".colHomeNav").css("display")=="none")
    {
    $(".colHomeNav").slideToggle();
    }
    });
    //quand on resort de déroulant
    $(".colHomeNav").hover(function(){
        //rien
    },function(){
        //si le div déroulant est visible, on le cache
        if($(".colHomeNav").css("display")=="block")
        {
            $(".colHomeNav").slideToggle();
        }
    });
    */
});
</script> 
</body>

<?php echo $this->element('sql_dump');?>